package com.mixsmart.commonweb.bean.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicUpdate;

import com.mixsmart.commonweb.bean.ICreateTime;
import com.mixsmart.commonweb.bean.IPKStringBean;
import com.mixsmart.enums.YesNoType;

/**
 * 用户实体对象
 * @author lmq
 * @version 1.0
 * @since JDK版本大于等于1.6
 * 2016年1月26日
 */
@Entity
@Table(name="t_c_user")
@DynamicUpdate(true)
public class TCUser implements IPKStringBean, ICreateTime {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3078812380000592207L;

	private String id;
	
	private String username;
	
	private String password;
	
	/**
	 * 用户全名（姓名）
	 */
	private String fullName;
	
	private Integer state = YesNoType.YES.getIndex();
	
	/**
	 * 组织机构ID(部门ID)
	 */
	private String orgId;
	
	/**
	 * 电话号码
	 */
	private String phoneNum;
	
	private String email;
	
	private Date createTime;
	
	private Integer sortNum;

	public TCUser() {

	}

	public TCUser(String username, String password, String fullName,
			Integer state, String orgId) {
		this.username = username;
		this.password = password;
		this.fullName = fullName;
		this.state = state;
		this.orgId = orgId;
	}

	///////getter and setter///////
	
	@Id
	@Column(name="id", length=50, nullable=false)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name="username", length=50, nullable=false, unique=true)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name="password", length=50)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name="full_name", length=255)
	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Column(name="state", length=2)
	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name="org_id", length=50)
	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time",updatable=false)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name="phone_num", length=20)
	public String getPhoneNum() {
		return phoneNum;
	}

	public void setPhoneNum(String phoneNum) {
		this.phoneNum = phoneNum;
	}

	@Column(name="email", length=50)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name="sort_num")
	public Integer getSortNum() {
		return sortNum;
	}

	public void setSortNum(Integer sortNum) {
		this.sortNum = sortNum;
	}
	
}
